import Vue from "vue";
import VueRouter from "vue-router";
Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    redirect: "/home",
  },
  {
    path: "/home",
    component: () => import("@/views/Home/Home.vue"),
    meta: {
      isShowNav: true,
    },
  },
  {
    path: "/cart",
    component: () => import("@/views/Cart/Cart.vue"),
    meta: {
      isShowNav: true,
    },
  },
  {
    path: "/category",
    component: () => import("@/views/Category/Category.vue"),
    meta: {
      isShowNav: true,
    },
  },
  {
    path: "/user",
    component: () => import("@/views/User/User.vue"),
    meta: {
      isShowNav: true,
    },
  },
  {
    path: "/login",
    component: () => import("@/views/Login/Login.vue"),
    meta: {
      isShowNav: false,
    },
  },
  {
    path: "/info/:productId",
    component: () => import("@/views/Info/Info.vue"),
    meta: {
      isShowNav: false,
    },
  },
  {
    path: "/addressList",
    component: () => import("@/views/Address/AddressList.vue"),
    meta: {
      isShowNav: false,
    },
  },
  {
    path: "/addressAdd",
    component: () => import("@/views/Address/AddressAdd.vue"),
    meta: {
      isShowNav: false,
    },
  },
  {
    path: "/addressEdit/:addressId",
    component: () => import("@/views/Address/AddressEdit.vue"),
    meta: {
      isShowNav: false,
    },
  },
  {
    path: "/create-order/:addressId",
    component: () => import("@/views/CreateOrder/CreateOrder.vue"),
    meta: {
      isShowNav: false,
    },
  },
  {
    path: "/myorder",
    component: () => import("@/views/MyOrder/MyOrder.vue"),
    meta: {
      isShowNav: false,
    },
  },
];
const router = new VueRouter({ routes });
export default router;
